package com.wing.product.strategy;

import cn.hutool.core.collection.CollectionUtil;
import com.wing.sell.model.response.OrderSkuDetailSearchVo;

import java.util.List;

/**
 * @Description: 规定了支付记录细节的流程，在其中选择具体的支付策略，为controller提供支付接口
 * @Project: szgc-enterprise-coding
 * @Package: com.wing.sell.strategy.AbstractGenerateOrderService
 * @Date: 2024/12/16 10:06
 * @Author: heZhou
 * @Version: 1.0
 */
public abstract class AbstractTOrderService implements OrderTStrategy {

    protected String orderType;

    /**
     * 获取订单信息
     * @param type 类型
     * @param orderId 订单id
     * @return 物料信息
     */
    public List<OrderSkuDetailSearchVo> getDetailBy(String type, Long orderId){
        this.orderType = type;
        boolean generateOrder = isGenerateOrder(type);
        if (generateOrder) {
            List<OrderSkuDetailSearchVo> detailBy = getDetailBy(orderId);
            if (CollectionUtil.isNotEmpty(detailBy)) {
                return detailBy;
            }
        }
        return null;
    }
}
